//
//  AreaModel.m
//  OC05_Homework
//
//  Created by dllo on 16/7/9.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "AreaModel.h"

@implementation AreaModel
// 指派初始化方法
- (instancetype)initWithName:(NSString *)name number:(NSString *)number
{
    self = [super init];
    if (self) {
        _name = name;
        _number = number;
    }
    return self;
}
+ (instancetype)areaModelWithAreaName:(NSString *)name number:(NSString *)number
{
    return [[self alloc] initWithName:name number:number];
}

- (instancetype)initWithName:(NSString *)name
{
    return [self initWithName:name number:nil];
}
+ (instancetype)areaModelWithAreaName:(NSString *)name
{
    return [[self alloc] initWithName:name];
}

- (instancetype)initWithTempCity:(TempCity *)tempCity
{
    return [self initWithName:tempCity.cityName number:tempCity.cityNumber];
}
+ (instancetype)areaModelWithTempCity:(TempCity *)tempCity
{
    return [[self alloc] initWithTempCity:tempCity];
}

- (NSString *)description
{
    return [NSString stringWithFormat:@"%@ %@", _name, _number];
}
@end
